using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bxas.Core;
using System.Xml.Serialization;
using PhotoHsn.BLL.Abstracts;
using PhotoHsn.BLL.Adapters;
using PhotoHsn.BLL.Core;
using Bxas.Core.Exceptions;

namespace PhotoHsn.BLL.Adapters
{
    [XmlType(Namespace = "urn:DataObjects")]
    [XmlRoot(Namespace = "urn:DataObjects")]
    [Serializable]
    public class Members : ColumnInfo
    {
        public Members()
        {
            this.priymatyKeyColumnName = "Id";
            this.priymatyKeyColumnType = typeof(System.Guid);
            this.TableName = "Members";
        }

        #region Fields
        private Guid id = System.Guid.Empty;
        private string userName = string.Empty;
        private string password = string.Empty;
        private string email = string.Empty;
        private string firstName = string.Empty;
        private string middleName = string.Empty;
        private string lastName = string.Empty;
        private bool gender = false;
        private DateTime birthDate = new DateTime();
        private string webSite = string.Empty;
        private string telephone = string.Empty;
        private string mobilePhone = string.Empty;
        private string fax = string.Empty;
        private string address = string.Empty;
        private Int64 cityId = -1;
        private Int32 languageId = -1;
        private byte status = 0;
        private Guid securityQuestionId = System.Guid.Empty;
        private string securityResponse = string.Empty;
        private Int16 wrongPasswordCount = -1;
        private DateTime lastWrongPasswordTime = new DateTime();
        private DateTime lastLoginTime = new DateTime();
        private DateTime createDate = new DateTime();
        private DateTime modifiedDate = new DateTime();
        private bool isActive = false;
        private bool isDeleted = false;
        private bool isOnline = false;
        private Int32 isStatus = -1;
        private byte[] avatar = null;

        #endregion

        #region Properties

        ///<summary>
        ///Required = true
        ///DBType = uniqueidentifier
        ///C# Type = Guid
        ///</summary> 
        [ColumnAttributes("Id", true, "Guid")]
        public Guid Id
        {
            get
            {
                return id;
            }
            set
            {
                if (value != id)
                {
                    id = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Id))
                        IsUpdateOrInsert.Add(Members.ColumnNames.Id, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = nvarchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("UserName", true, "string")]
        public string UserName
        {
            get
            {
                return userName;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != userName)
                {
                    userName = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.UserName))
                        IsUpdateOrInsert.Add(Members.ColumnNames.UserName, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = nvarchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("Password", true, "string")]
        public string Password
        {
            get
            {
                return password;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != password)
                {
                    password = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Password))
                        IsUpdateOrInsert.Add(Members.ColumnNames.Password, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = nvarchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("Email", true, "string")]
        public string Email
        {
            get
            {
                return email;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != email)
                {
                    email = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Email))
                        IsUpdateOrInsert.Add(Members.ColumnNames.Email, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = nchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("FirstName", true, "string")]
        public string FirstName
        {
            get
            {
                return firstName;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != firstName)
                {
                    firstName = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.FirstName))
                        IsUpdateOrInsert.Add(Members.ColumnNames.FirstName, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = nchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("MiddleName", false, "string")]
        public string MiddleName
        {
            get
            {
                return middleName;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != middleName)
                {
                    middleName = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.MiddleName))
                        IsUpdateOrInsert.Add(Members.ColumnNames.MiddleName, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = nchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("LastName", true, "string")]
        public string LastName
        {
            get
            {
                return lastName;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != lastName)
                {
                    lastName = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.LastName))
                        IsUpdateOrInsert.Add(Members.ColumnNames.LastName, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = bit
        ///C# Type = bool
        ///</summary> 
        [ColumnAttributes("Gender", false, "bool")]
        public bool Gender
        {
            get
            {
                return gender;
            }
            set
            {
                if (value != gender)
                {
                    gender = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Gender))
                        IsUpdateOrInsert.Add(Members.ColumnNames.Gender, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = datetime
        ///C# Type = DateTime
        ///</summary> 
        [ColumnAttributes("BirthDate", false, "DateTime")]
        public DateTime BirthDate
        {
            get
            {
                return birthDate;
            }
            set
            {
                if (value != birthDate)
                {
                    birthDate = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.BirthDate))
                        IsUpdateOrInsert.Add(Members.ColumnNames.BirthDate, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = nvarchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("WebSite", false, "string")]
        public string WebSite
        {
            get
            {
                return webSite;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != webSite)
                {
                    webSite = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.WebSite))
                        IsUpdateOrInsert.Add(Members.ColumnNames.WebSite, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = nvarchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("Telephone", false, "string")]
        public string Telephone
        {
            get
            {
                return telephone;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != telephone)
                {
                    telephone = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Telephone))
                        IsUpdateOrInsert.Add(Members.ColumnNames.Telephone, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = nvarchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("MobilePhone", false, "string")]
        public string MobilePhone
        {
            get
            {
                return mobilePhone;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != mobilePhone)
                {
                    mobilePhone = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.MobilePhone))
                        IsUpdateOrInsert.Add(Members.ColumnNames.MobilePhone, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = nvarchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("Fax", false, "string")]
        public string Fax
        {
            get
            {
                return fax;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != fax)
                {
                    fax = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Fax))
                        IsUpdateOrInsert.Add(Members.ColumnNames.Fax, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = nvarchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("Address", false, "string")]
        public string Address
        {
            get
            {
                return address;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != address)
                {
                    address = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Address))
                        IsUpdateOrInsert.Add(Members.ColumnNames.Address, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = bigint
        ///C# Type = Int64
        ///</summary> 
        [ColumnAttributes("CityId", false, "Int64")]
        public Int64 CityId
        {
            get
            {
                return cityId;
            }
            set
            {
                if (value != cityId)
                {
                    cityId = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.CityId))
                        IsUpdateOrInsert.Add(Members.ColumnNames.CityId, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = int
        ///C# Type = Int32
        ///</summary> 
        [ColumnAttributes("LanguageId", false, "Int32")]
        public Int32 LanguageId
        {
            get
            {
                return languageId;
            }
            set
            {
                if (value != languageId)
                {
                    languageId = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.LanguageId))
                        IsUpdateOrInsert.Add(Members.ColumnNames.LanguageId, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = tinyint
        ///C# Type = byte
        ///</summary> 
        [ColumnAttributes("Status", false, "byte")]
        public byte Status
        {
            get
            {
                return status;
            }
            set
            {
                if (value != status)
                {
                    status = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Status))
                        IsUpdateOrInsert.Add(Members.ColumnNames.Status, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = uniqueidentifier
        ///C# Type = Guid
        ///</summary> 
        [ColumnAttributes("SecurityQuestionId", true, "Guid")]
        public Guid SecurityQuestionId
        {
            get
            {
                return securityQuestionId;
            }
            set
            {
                if (value != securityQuestionId)
                {
                    securityQuestionId = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.SecurityQuestionId))
                        IsUpdateOrInsert.Add(Members.ColumnNames.SecurityQuestionId, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = nvarchar
        ///C# Type = string
        ///</summary> 
        [ColumnAttributes("SecurityResponse", true, "string")]
        public string SecurityResponse
        {
            get
            {
                return securityResponse;
            }
            set
            {
                string valueTrimmed = value.Trim();

                if (valueTrimmed != securityResponse)
                {
                    securityResponse = valueTrimmed;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.SecurityResponse))
                        IsUpdateOrInsert.Add(Members.ColumnNames.SecurityResponse, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = smallint
        ///C# Type = Int16
        ///</summary> 
        [ColumnAttributes("WrongPasswordCount", true, "Int16")]
        public Int16 WrongPasswordCount
        {
            get
            {
                return wrongPasswordCount;
            }
            set
            {
                if (value != wrongPasswordCount)
                {
                    wrongPasswordCount = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.WrongPasswordCount))
                        IsUpdateOrInsert.Add(Members.ColumnNames.WrongPasswordCount, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = datetime
        ///C# Type = DateTime
        ///</summary> 
        [ColumnAttributes("LastWrongPasswordTime", false, "DateTime")]
        public DateTime LastWrongPasswordTime
        {
            get
            {
                return lastWrongPasswordTime;
            }
            set
            {
                if (value != lastWrongPasswordTime)
                {
                    lastWrongPasswordTime = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.LastWrongPasswordTime))
                        IsUpdateOrInsert.Add(Members.ColumnNames.LastWrongPasswordTime, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = datetime
        ///C# Type = DateTime
        ///</summary> 
        [ColumnAttributes("LastLoginTime", false, "DateTime")]
        public DateTime LastLoginTime
        {
            get
            {
                return lastLoginTime;
            }
            set
            {
                if (value != lastLoginTime)
                {
                    lastLoginTime = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.LastLoginTime))
                        IsUpdateOrInsert.Add(Members.ColumnNames.LastLoginTime, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = datetime
        ///C# Type = DateTime
        ///</summary> 
        [ColumnAttributes("CreateDate", true, "DateTime")]
        public DateTime CreateDate
        {
            get
            {
                return createDate;
            }
            set
            {
                if (value != createDate)
                {
                    createDate = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.CreateDate))
                        IsUpdateOrInsert.Add(Members.ColumnNames.CreateDate, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = datetime
        ///C# Type = DateTime
        ///</summary> 
        [ColumnAttributes("ModifiedDate", true, "DateTime")]
        public DateTime ModifiedDate
        {
            get
            {
                return modifiedDate;
            }
            set
            {
                if (value != modifiedDate)
                {
                    modifiedDate = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.ModifiedDate))
                        IsUpdateOrInsert.Add(Members.ColumnNames.ModifiedDate, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = bit
        ///C# Type = bool
        ///</summary> 
        [ColumnAttributes("IsActive", true, "bool")]
        public bool IsActive
        {
            get
            {
                return isActive;
            }
            set
            {
                if (value != isActive)
                {
                    isActive = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.IsActive))
                        IsUpdateOrInsert.Add(Members.ColumnNames.IsActive, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = bit
        ///C# Type = bool
        ///</summary> 
        [ColumnAttributes("IsDeleted", true, "bool")]
        public bool IsDeleted
        {
            get
            {
                return isDeleted;
            }
            set
            {
                if (value != isDeleted)
                {
                    isDeleted = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.IsDeleted))
                        IsUpdateOrInsert.Add(Members.ColumnNames.IsDeleted, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = bit
        ///C# Type = bool
        ///</summary> 
        [ColumnAttributes("IsOnline", true, "bool")]
        public bool IsOnline
        {
            get
            {
                return isOnline;
            }
            set
            {
                if (value != isOnline)
                {
                    isOnline = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.IsOnline))
                        IsUpdateOrInsert.Add(Members.ColumnNames.IsOnline, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = int
        ///C# Type = Int32
        ///</summary> 
        [ColumnAttributes("IsStatus", true, "Int32")]
        public Int32 IsStatus
        {
            get
            {
                return isStatus;
            }
            set
            {
                if (value != isStatus)
                {
                    isStatus = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.IsStatus))
                        IsUpdateOrInsert.Add(Members.ColumnNames.IsStatus, true);
                    this.IsDirty = true;
                }
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = image
        ///C# Type = byte[]
        ///</summary> 
        [ColumnAttributes("Avatar", false, "byte[]")]
        public byte[] Avatar
        {
            get
            {
                return avatar;
            }
            set
            {
                if (value != avatar)
                {
                    avatar = value;
                    if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Avatar))
                        IsUpdateOrInsert.Add(Members.ColumnNames.Avatar, true);
                    this.IsDirty = true;
                }
            }
        }

        #endregion

        #region StringProperties

        ///<summary>
        ///Required = true
        ///DBType = Guid
        ///C# Type = Guid
        ///</summary> 
        public virtual string s_Id
        {
            get
            {
                return Getuniqueidentifier_s(id);
            }
            set
            {
                Setuniqueidentifier_s(value, ref id);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Id))
                    IsUpdateOrInsert.Add(Members.ColumnNames.Id, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_UserName
        {
            get
            {
                return Getnvarchar_s(userName);
            }
            set
            {
                Setnvarchar_s(value, ref userName);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.UserName))
                    IsUpdateOrInsert.Add(Members.ColumnNames.UserName, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_Password
        {
            get
            {
                return Getnvarchar_s(password);
            }
            set
            {
                Setnvarchar_s(value, ref password);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Password))
                    IsUpdateOrInsert.Add(Members.ColumnNames.Password, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_Email
        {
            get
            {
                return Getnvarchar_s(email);
            }
            set
            {
                Setnvarchar_s(value, ref email);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Email))
                    IsUpdateOrInsert.Add(Members.ColumnNames.Email, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_FirstName
        {
            get
            {
                return Getnchar_s(firstName);
            }
            set
            {
                Setnchar_s(value, ref firstName);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.FirstName))
                    IsUpdateOrInsert.Add(Members.ColumnNames.FirstName, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_MiddleName
        {
            get
            {
                return Getnchar_s(middleName);
            }
            set
            {
                Setnchar_s(value, ref middleName);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.MiddleName))
                    IsUpdateOrInsert.Add(Members.ColumnNames.MiddleName, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_LastName
        {
            get
            {
                return Getnchar_s(lastName);
            }
            set
            {
                Setnchar_s(value, ref lastName);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.LastName))
                    IsUpdateOrInsert.Add(Members.ColumnNames.LastName, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = bool
        ///C# Type = bool
        ///</summary> 
        public virtual string s_Gender
        {
            get
            {
                return Getbit_s(gender);
            }
            set
            {
                Setbit_s(value, ref gender);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Gender))
                    IsUpdateOrInsert.Add(Members.ColumnNames.Gender, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = DateTime
        ///C# Type = DateTime
        ///</summary> 
        public virtual string s_BirthDate
        {
            get
            {
                return Getdatetime_s(birthDate);
            }
            set
            {
                Setdatetime_s(value, ref birthDate);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.BirthDate))
                    IsUpdateOrInsert.Add(Members.ColumnNames.BirthDate, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_WebSite
        {
            get
            {
                return Getnvarchar_s(webSite);
            }
            set
            {
                Setnvarchar_s(value, ref webSite);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.WebSite))
                    IsUpdateOrInsert.Add(Members.ColumnNames.WebSite, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_Telephone
        {
            get
            {
                return Getnvarchar_s(telephone);
            }
            set
            {
                Setnvarchar_s(value, ref telephone);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Telephone))
                    IsUpdateOrInsert.Add(Members.ColumnNames.Telephone, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_MobilePhone
        {
            get
            {
                return Getnvarchar_s(mobilePhone);
            }
            set
            {
                Setnvarchar_s(value, ref mobilePhone);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.MobilePhone))
                    IsUpdateOrInsert.Add(Members.ColumnNames.MobilePhone, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_Fax
        {
            get
            {
                return Getnvarchar_s(fax);
            }
            set
            {
                Setnvarchar_s(value, ref fax);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Fax))
                    IsUpdateOrInsert.Add(Members.ColumnNames.Fax, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_Address
        {
            get
            {
                return Getnvarchar_s(address);
            }
            set
            {
                Setnvarchar_s(value, ref address);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Address))
                    IsUpdateOrInsert.Add(Members.ColumnNames.Address, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = Int64
        ///C# Type = Int64
        ///</summary> 
        public virtual string s_CityId
        {
            get
            {
                return Getbigint_s(cityId);
            }
            set
            {
                Setbigint_s(value, ref cityId);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.CityId))
                    IsUpdateOrInsert.Add(Members.ColumnNames.CityId, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = Int32
        ///C# Type = Int32
        ///</summary> 
        public virtual string s_LanguageId
        {
            get
            {
                return Getint_s(languageId);
            }
            set
            {
                Setint_s(value, ref languageId);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.LanguageId))
                    IsUpdateOrInsert.Add(Members.ColumnNames.LanguageId, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = byte
        ///C# Type = byte
        ///</summary> 
        public virtual string s_Status
        {
            get
            {
                return Gettinyint_s(status);
            }
            set
            {
                Settinyint_s(value, ref status);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Status))
                    IsUpdateOrInsert.Add(Members.ColumnNames.Status, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = Guid
        ///C# Type = Guid
        ///</summary> 
        public virtual string s_SecurityQuestionId
        {
            get
            {
                return Getuniqueidentifier_s(securityQuestionId);
            }
            set
            {
                Setuniqueidentifier_s(value, ref securityQuestionId);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.SecurityQuestionId))
                    IsUpdateOrInsert.Add(Members.ColumnNames.SecurityQuestionId, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = string
        ///C# Type = string
        ///</summary> 
        public virtual string s_SecurityResponse
        {
            get
            {
                return Getnvarchar_s(securityResponse);
            }
            set
            {
                Setnvarchar_s(value, ref securityResponse);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.SecurityResponse))
                    IsUpdateOrInsert.Add(Members.ColumnNames.SecurityResponse, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = Int16
        ///C# Type = Int16
        ///</summary> 
        public virtual string s_WrongPasswordCount
        {
            get
            {
                return Getsmallint_s(wrongPasswordCount);
            }
            set
            {
                Setsmallint_s(value, ref wrongPasswordCount);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.WrongPasswordCount))
                    IsUpdateOrInsert.Add(Members.ColumnNames.WrongPasswordCount, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = DateTime
        ///C# Type = DateTime
        ///</summary> 
        public virtual string s_LastWrongPasswordTime
        {
            get
            {
                return Getdatetime_s(lastWrongPasswordTime);
            }
            set
            {
                Setdatetime_s(value, ref lastWrongPasswordTime);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.LastWrongPasswordTime))
                    IsUpdateOrInsert.Add(Members.ColumnNames.LastWrongPasswordTime, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = DateTime
        ///C# Type = DateTime
        ///</summary> 
        public virtual string s_LastLoginTime
        {
            get
            {
                return Getdatetime_s(lastLoginTime);
            }
            set
            {
                Setdatetime_s(value, ref lastLoginTime);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.LastLoginTime))
                    IsUpdateOrInsert.Add(Members.ColumnNames.LastLoginTime, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = DateTime
        ///C# Type = DateTime
        ///</summary> 
        public virtual string s_CreateDate
        {
            get
            {
                return Getdatetime_s(createDate);
            }
            set
            {
                Setdatetime_s(value, ref createDate);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.CreateDate))
                    IsUpdateOrInsert.Add(Members.ColumnNames.CreateDate, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = DateTime
        ///C# Type = DateTime
        ///</summary> 
        public virtual string s_ModifiedDate
        {
            get
            {
                return Getdatetime_s(modifiedDate);
            }
            set
            {
                Setdatetime_s(value, ref modifiedDate);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.ModifiedDate))
                    IsUpdateOrInsert.Add(Members.ColumnNames.ModifiedDate, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = bool
        ///C# Type = bool
        ///</summary> 
        public virtual string s_IsActive
        {
            get
            {
                return Getbit_s(isActive);
            }
            set
            {
                Setbit_s(value, ref isActive);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.IsActive))
                    IsUpdateOrInsert.Add(Members.ColumnNames.IsActive, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = bool
        ///C# Type = bool
        ///</summary> 
        public virtual string s_IsDeleted
        {
            get
            {
                return Getbit_s(isDeleted);
            }
            set
            {
                Setbit_s(value, ref isDeleted);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.IsDeleted))
                    IsUpdateOrInsert.Add(Members.ColumnNames.IsDeleted, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = bool
        ///C# Type = bool
        ///</summary> 
        public virtual string s_IsOnline
        {
            get
            {
                return Getbit_s(isOnline);
            }
            set
            {
                Setbit_s(value, ref isOnline);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.IsOnline))
                    IsUpdateOrInsert.Add(Members.ColumnNames.IsOnline, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = true
        ///DBType = Int32
        ///C# Type = Int32
        ///</summary> 
        public virtual string s_IsStatus
        {
            get
            {
                return Getint_s(isStatus);
            }
            set
            {
                Setint_s(value, ref isStatus);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.IsStatus))
                    IsUpdateOrInsert.Add(Members.ColumnNames.IsStatus, true);
                this.IsDirty = true;
            }
        }

        ///<summary>
        ///Required = false
        ///DBType = byte[]
        ///C# Type = byte[]
        ///</summary> 
        public virtual string s_Avatar
        {
            get
            {
                return Getimage_s(avatar);
            }
            set
            {
                Setimage_s(value, ref avatar);
                if (!IsUpdateOrInsert.ContainsKey(Members.ColumnNames.Avatar))
                    IsUpdateOrInsert.Add(Members.ColumnNames.Avatar, true);
                this.IsDirty = true;
            }
        }

        #endregion

        #region ColumnNames
        public class ColumnNames
        {
            public const string Id = "Id";
            public const string UserName = "UserName";
            public const string Password = "Password";
            public const string Email = "Email";
            public const string FirstName = "FirstName";
            public const string MiddleName = "MiddleName";
            public const string LastName = "LastName";
            public const string Gender = "Gender";
            public const string BirthDate = "BirthDate";
            public const string WebSite = "WebSite";
            public const string Telephone = "Telephone";
            public const string MobilePhone = "MobilePhone";
            public const string Fax = "Fax";
            public const string Address = "Address";
            public const string CityId = "CityId";
            public const string LanguageId = "LanguageId";
            public const string Status = "Status";
            public const string SecurityQuestionId = "SecurityQuestionId";
            public const string SecurityResponse = "SecurityResponse";
            public const string WrongPasswordCount = "WrongPasswordCount";
            public const string LastWrongPasswordTime = "LastWrongPasswordTime";
            public const string LastLoginTime = "LastLoginTime";
            public const string CreateDate = "CreateDate";
            public const string ModifiedDate = "ModifiedDate";
            public const string IsActive = "IsActive";
            public const string IsDeleted = "IsDeleted";
            public const string IsOnline = "IsOnline";
            public const string IsStatus = "IsStatus";
            public const string Avatar = "Avatar";

        }
        #endregion
    }
}

namespace PhotoHsn.BLL.Abstracts
{
    public class _MembersBs : BaseBs
    {
        public Boolean insert(Members p)
        {
            try
            {
                return this._insert<Members>(p);
            }
            catch (BxasCoreException ex)
            {
                throw ex;
            }
        }
        public Boolean update(Members p) { return this._update<Members>(p); }
        public Boolean delete(Members p) { return this._delete<Members>(p); }
        public List<Members> get(string sql)
        {
            try
            {
                return this._get<Members>(sql);
            }
            catch (BxasCoreException ex)
            {

                throw ex;
            }
        }

        public List<Members> get(System.Data.SqlClient.SqlCommand sqlcommand)
        {
            try
            {
                return this._get<Members>(sqlcommand);
            }
            catch (BxasCoreException ex)
            {

                throw ex;
            }
        }
        public List<Members> get_all(List<string> columnNames) { return this._get_all<Members>(columnNames); }
        public List<Members> get_all_with_all_columns() { return this._get_all_with_all_columns<Members>(); }
        public Members get_by_primarykey(System.Guid pk, List<string> columnNames) { return this._get_by_primarykey<Members>(pk, columnNames); }
    }
}
